"""
自定义异常类
"""


class FileConverterError(Exception):
    """文件转换器基础异常类"""
    
    def __init__(self, message: str, error_code: str = None):
        super().__init__(message)
        self.message = message
        self.error_code = error_code
    
    def __str__(self):
        if self.error_code:
            return f"[{self.error_code}] {self.message}"
        return self.message


class PDFProcessingError(FileConverterError):
    """PDF处理异常"""
    pass


class PPTConversionError(FileConverterError):
    """PPT转换异常"""
    pass


class FileNotFoundError(FileConverterError):
    """文件未找到异常"""
    pass


class InvalidFileFormatError(FileConverterError):
    """无效文件格式异常"""
    pass


class ConfigurationError(FileConverterError):
    """配置错误异常"""
    pass


class ResourceError(FileConverterError):
    """资源错误异常（内存、磁盘空间等）"""
    pass


class PermissionError(FileConverterError):
    """权限错误异常"""
    pass
